/**
 * @author  Xyz
 * 分公司管理-分公司详情
 */
import PDrawer from '../../../components/Pro/PDrawer';
import React from 'react';
import {
  Form,
  Input,
  Button,
  DatePicker,
  Popover,
  Icon
} from 'antd';
import {formItemLayout1} from './constants';
import {DrawHeader, Empty, DrawBottomBtns} from './styles';
import PCascader from '../../../components/Pro/PCascader';

const FormItem = Form.Item;
@Form.create()
export default class DrawBranchCompanyDetail extends React.Component {
  constructor(props, context) {
    super(props, context);

  }

  /******************************生命周期******************************/

  componentDidMount = () => {

  }

  /******************************ajax请求******************************/


  /******************************相关事件******************************/
  handleSubmit = (e) => {
    e.preventDefault();
    this.props.form.validateFields((err, values) => {
      if (!err) {

      }
    });
  }

  closeDrawer = () => {
    this.props.closeDrawer();
  }


  /******************************render******************************/

  render() {
    const {visible} = this.props;
    const {getFieldDecorator} = this.props.form;

    return (
      <PDrawer
        title="分公司详情"
        visible={visible}
        okText={null}
        cancelText="返回"
        onCancel={this.closeDrawer}
        onOk={this.handleSubmit}
        destroyOnClose={true}
      >
        <div>
          <Form onSubmit={this.handleSubmit} style={{width: 390, margin: "6px 0 81px 0"}}>
            <FormItem
              {...formItemLayout1}
              label="分公司详情"
              style={{marginTop: 24}}
            >
              {getFieldDecorator('t1', {
                rules: [{
                  type: 'email', message: 'The input is not valid E-mail!',
                }, {
                  required: true, message: 'Please input your E-mail!',
                }],
              })(
                <Input style={{width: 294}}/>
              )}
            </FormItem>
            <FormItem
              {...formItemLayout1}
              label="营业执照号"
              style={{marginTop: 24}}
            >
              {getFieldDecorator('t2', {
                rules: [{
                  type: 'email', message: 'The input is not valid E-mail!',
                }, {
                  required: true, message: 'Please input your E-mail!',
                }],
              })(
                <Input style={{width: 294}} placeholder="请输入"/>
              )}
            </FormItem>
            <FormItem
              {...formItemLayout1}
              label="注册地址"
              style={{marginTop: 24}}
            >
              {getFieldDecorator('t3', {
                rules: [{
                  type: 'email', message: 'The input is not valid E-mail!',
                }, {
                  required: true, message: 'Please input your E-mail!',
                }],
              })(
                <PCascader style={{width: 294}} placeholder="请选择"/>
              )}
            </FormItem>
            <Empty>
              <FormItem
                {...formItemLayout1}
                label=""
                style={{marginTop: 24}}
              >
                {getFieldDecorator('t4', {
                  rules: [{
                    type: 'email', message: 'The input is not valid E-mail!',
                  }, {
                    required: true, message: 'Please input your E-mail!',
                  }],
                })(
                  <Input style={{width: 294}} placeholder="请填写公司注册详细地址"/>
                )}
              </FormItem>
            </Empty>

            <FormItem
              {...formItemLayout1}
              label="经营地址"
              style={{marginTop: 24}}
            >
              {getFieldDecorator('t5', {
                rules: [{
                  type: 'email', message: 'The input is not valid E-mail!',
                }, {
                  required: true, message: 'Please input your E-mail!',
                }],
              })(
                <PCascader style={{width: 294}} placeholder="请选择"/>
              )}
            </FormItem>
            <Empty>
              <FormItem
                {...formItemLayout1}
                label=""
                style={{marginTop: 24}}
              >
                {getFieldDecorator('t6', {
                  rules: [{
                    type: 'email', message: 'The input is not valid E-mail!',
                  }, {
                    required: true, message: 'Please input your E-mail!',
                  }],
                })(
                  <Input style={{width: 294}} placeholder="请填写公司注册详细地址"/>
                )}
              </FormItem>
            </Empty>
            <FormItem
              {...formItemLayout1}
              label="负责人"
              style={{marginTop: 24}}
            >
              {getFieldDecorator('t7', {
                rules: [{
                  type: 'email', message: 'The input is not valid E-mail!',
                }, {
                  required: true, message: 'Please input your E-mail!',
                }],
              })(
                <Input style={{width: 294}} placeholder="请输入"/>
              )}
            </FormItem>
            <FormItem
              {...formItemLayout1}
              label="负责人手机号"
              style={{marginTop: 24}}
            >
              {getFieldDecorator('t8', {
                rules: [{
                  type: 'email', message: 'The input is not valid E-mail!',
                }, {
                  required: true, message: 'Please input your E-mail!',
                }],
              })(
                <Input style={{width: 294}} placeholder="请输入"/>
              )}
            </FormItem>
            <FormItem
              {...formItemLayout1}
              label="负责人身份证号"
              style={{marginTop: 24}}
            >
              {getFieldDecorator('t9', {
                rules: [{
                  type: 'email', message: 'The input is not valid E-mail!',
                }, {
                  required: true, message: 'Please input your E-mail!',
                }],
              })(
                <Input style={{width: 294}} placeholder="请输入"/>
              )}
            </FormItem>
            <FormItem
              {...formItemLayout1}
              label="备案公安机关名称"
              style={{marginTop: 24}}
            >
              {getFieldDecorator('t10', {
                rules: [{
                  type: 'email', message: 'The input is not valid E-mail!',
                }, {
                  required: true, message: 'Please input your E-mail!',
                }],
              })(
                <Input style={{width: 294}} placeholder="请输入"/>
              )}
            </FormItem>
            <FormItem
              {...formItemLayout1}
              label="备案公安机关名称"
              style={{marginTop: 24}}
            >
              {getFieldDecorator('t11', {
                rules: [{
                  type: 'email', message: 'The input is not valid E-mail!',
                }, {
                  required: true, message: 'Please input your E-mail!',
                }],
              })(
                <DatePicker style={{width: 294}}/>
              )}
            </FormItem>
          </Form>
        </div>
      </PDrawer>
    );
  }
}
